# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=metalog
pkgver=20200113
pkgrel=0
pkgdesc="small, simple to config, flexible syslogd/klogd daemon"
url="https://github.com/hvisage/metalog"
arch="all"
license="GPL-2.0-only"
makedepends="pcre-dev automake autoconf autoconf-archive"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/hvisage/metalog/archive/metalog-$pkgver.tar.gz
	metalog.initd
	metalog.confd
	"
builddir="$srcdir/"metalog-metalog-$pkgver

prepare() {
	./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="d399d86f988c69c9f74553cd682a5fe04886bca458e6f8bb3132fe1fb9f522510a428cfde8af0857c5ba22531b276b04fa05183e0006c2d28ef0f0aead488f93  metalog-20200113.tar.gz
09d8ac585418c6a3dfccc9d0f1a050b5862924712d78dc44fce3cb497bb362afe0a556240b14cf957fcdf64d0d06f5b6a8df4372c69129b43dc3520ecd310344  metalog.initd
1efbc74e23abef06bd62b35bb1f4166b86b5b4618d81e8eb085b4c9b45d0c4319b6db19a24648f7010400eed05c2486e16f16176a0e5435d7f263492934019c6  metalog.confd"
